﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace InsuranceVehicle
{
    public partial class UserMenuControl : System.Web.UI.UserControl
    {
        private string selectedMenu;

        public string SelectedMenu
        {
            get { return selectedMenu; }
            set { selectedMenu = value; }
        }

        private string showElement;

        public string ShowElement
        {
            get { return showElement; }
            set { showElement = value; }
        }
        
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                renderMenu();
            }
        }

        private void renderMenu()
        {
            //if (showElement.Equals("all"))
            //{
                if (selectedMenu.Equals("about_us"))
                {
                    userMenu.Text += "<li id=\"m1\" class=\"act\"><a href=\"AboutUs.aspx\">About us</a></li>";
                }
                else
                {
                    userMenu.Text += "<li id=\"m1\"><a href=\"AboutUs.aspx\">About us</a></li>";
                }

                if (selectedMenu.Equals("insurance"))
                {
                    userMenu.Text += "<li id=\"m2\" class=\"act\"><a href=\"Insurance.aspx\">Insurance Type</a></li>";
                }
                else
                {
                    userMenu.Text += "<li id=\"m2\"><a href=\"Insurance.aspx\">Insurance Type</a></li>";
                }

                if (selectedMenu.Equals("policy"))
                {
                    userMenu.Text += "<li id=\"m3\" class=\"act\"><a href=\"PolicyInsurance.aspx\">Buy Insurance</a></li>";
                }
                else
                {
                    userMenu.Text += "<li id=\"m3\"><a href=\"PolicyInsurance.aspx\">Buy Insurance</a></li>";
                }

                if (selectedMenu.Equals("claim"))
                {
                    userMenu.Text += "<li id=\"m4\" class=\"act\"><a href=\"Claim.aspx\">Claim</a></li>";
                }
                else
                {
                    userMenu.Text += "<li id=\"m4\"><a href=\"Claim.aspx\">Claim</a></li>";
                }

                if (selectedMenu.Equals("renewal"))
                {
                    userMenu.Text += "<li id=\"m5\" class=\"act\"><a href=\"RenewalInsurance.aspx\">Renewal Insurance</a></li>";
                }
                else
                {
                    userMenu.Text += "<li id=\"m5\"><a href=\"RenewalInsurance.aspx\">Renewal Insurance</a></li>";
                }

                if (selectedMenu.Equals("my_account"))
                {
                    userMenu.Text += "<li id=\"m6\" class=\"act\"><a href=\"UpdateCustomerInfo.aspx\">My Account</a></li>";
                }
                else
                {
                    userMenu.Text += "<li id=\"m6\"><a href=\"UpdateCustomerInfo.aspx\">My Account</a></li>";
                }

                if (selectedMenu.Equals("register"))
                {
                    userMenu.Text += "<li id=\"m7\" class=\"act\"><a href=\"RegisterCustomer.aspx\">Register</a></li>";
                }
                else
                {
                    userMenu.Text += "<li id=\"m7\"><a href=\"RegisterCustomer.aspx\">Register</a></li>";
                }

                if (selectedMenu.Equals("contact_us"))
                {
                    userMenu.Text += "<li id=\"Li1\" class=\"act\"><a href=\"ContactUs.aspx\">Contact us</a></li>";
                }
                else
                {
                    userMenu.Text += "<li id=\"Li1\"><a href=\"ContactUs.aspx\">Contact us</a></li>";
                }
           // }
               
        }
    }
}